package com.lixixi.tingshu.album.config;

import com.lixixi.tingshu.album.properties.MinioProperties;
import io.minio.MinioClient;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioConfig {

	@Resource
	MinioProperties minioProperties;

	@Bean
	MinioClient minioClient(){
		return MinioClient.builder()
				.endpoint(minioProperties.endPoint)
				.credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
				.build();
	}
}
